//
//  CustomTitleView.m
//  ProductB
//
//  Created by 田阳 on 16/8/5.
//  Copyright © 2016年 田阳. All rights reserved.
//

#import "CustomTitleView.h"
@implementation CustomTitleView

- (instancetype)initWithFrame:(CGRect)frame action:(SEL)action
{
    self = [super initWithFrame:frame];
    if (self) {
       
            self.label = [[UILabel alloc] initWithFrame:CGRectMake(0, 0, kScreenWidth / 5, self.ownHeight - 3)];
            _label.font = [UIFont systemFontOfSize:15];
            _label.textColor = [UIColor blackColor];
            _label.textAlignment = NSTextAlignmentCenter;
            [self addSubview:_label];
            
            //给label添加手势
            UITapGestureRecognizer *tap = [[UITapGestureRecognizer alloc]initWithTarget:self action:action];
            [self.label addGestureRecognizer:tap];
            
            self.myView = [[UIView alloc] initWithFrame:CGRectMake(0, _label.endY + 1, 30, 2)];
            _myView.centerX = _label.centerX;
            _myView.backgroundColor = [UIColor whiteColor];
            [self addSubview:_myView];
        
        
    }
    return  self;
}

@end
